import createPalette from '@mui/material/styles/createPalette';

const colors = {
  black: '#000000',
  white: '#FFFFFF',
  transparent: 'transparent',

  black90: '#091E42',
  black80: '#253858',
  black70: '#42526E',
  black60: '#5E6C84',
  black50: '#7A869A',
  black40: '#97A0AF',
  black30: '#A8B0BD',
  black20: '#C1C7D0',
  black15: '#DFE1E6',
  black10: '#EBECF0',
  black5: '#F0F2F4',
  black3: '#F6F7F9',

  blue65: '#0035A8',
  blue60: '#0044D6',
  blue50: '#0A58FF',
  blue40: '#3877FF',
  blue30: '#528EFF',
  blue20: '#80AEFF',
  blue10: '#B3D1FF',
  blue5: '#E5EEFF',
  blue3: '#F0F5FF',

  orange50: '#FFAA00',
  orange40: '#FFBB33',
  orange20: '#FFDD99',
  orange10: '#FFEECC',
  orange5: '#FFF6E5',

  green60: '#1FAD1F',
  green50: '#17CF54',
  green40: '#14B84B',
  green20: '#A8F0A8',
  green10: '#D1FADF',
  green5: '#E8FCEF',

  lightGreen60: '#A7FF33',
  lightGreen40: '#D3FF99',
  lightGreen5: '#F4FFE5',

  turquoise40: '#33FF99',
  turquoise20: '#99FFCC',

  red60: '#C2290A',
  red50: '#F2330D',
  red40: '#F55C3D',
  red20: '#FF9999',
  red10: '#FFCCCC',
  red5: '#FFE5E6',

  pink60: '#EE99FF',

  purple40: '#5533FF',
  purple30: '#8066FF',
  purple20: '#AA99FF',
  purple10: '#D4CCFF',
  purple5: '#EAE5FF',
} as const;

export const palette = createPalette({
  border: {
    primary: colors.black10,
    secondary: colors.black20,
    tertiary: colors.black30,
    element: colors.blue50,
    light: colors.black5,
  },
  common: { black: colors.black, white: colors.white },
  texts: {
    primary: colors.black90,
    secondary: colors.black50,
    secondaryVariant: colors.black40,
    hint: colors.black30,
    info: colors.black70,
    action: colors.blue60,
  },
  warning: {
    main: colors.red50,
    light: colors.orange10,
  },
  backgrounds: {
    primary: colors.black5,
    secondary: colors.black10,
    tertiary: colors.black3,
    darken: colors.black90,
    element: colors.blue50,
    default: colors.white,
    transparent: colors.transparent,
  },
  info: {
    main: colors.black90,
    light: colors.black20,
    dark: colors.black80,
  },
  divider: colors.black10,
  entityClass: {
    DATA_SET: colors.red5,
    DATA_TRANSFORMER: colors.purple5,
    DATA_CONSUMER: colors.blue5,
    DATA_INPUT: colors.green5,
    DATA_QUALITY_TEST: colors.orange5,
    DATA_TRANSFORMER_RUN: colors.purple5,
    DATA_QUALITY_TEST_RUN: colors.orange5,
    DATA_ENTITY_GROUP: colors.lightGreen5,
    DATA_RELATIONSHIP: colors.lightGreen5,
  },
  dataQualityDashboard: {
    monitored: colors.green60,
    nonMonitored: colors.black30,
    healthy: colors.green60,
    warning: colors.orange50,
    error: colors.red50,
    unknown: colors.black30,
  },
  runStatus: {
    SUCCESS: { color: colors.green60, background: colors.green5 },
    FAILED: { color: colors.red50, background: colors.red5 },
    BROKEN: { color: colors.orange50, background: colors.orange5 },
    SKIPPED: { color: colors.blue50, background: colors.blue5 },
    ABORTED: { color: colors.purple30, background: colors.purple5 },
    UNKNOWN: { color: colors.black30, background: colors.black5 },
  },
  reportStatus: {
    SUCCESS: { background: colors.green10, border: colors.green20 },
    FAILED: { background: colors.red10, border: colors.red20 },
    BROKEN: { background: colors.orange10, border: colors.orange20 },
    SKIPPED: { background: colors.blue10, border: colors.blue20 },
    ABORTED: { background: colors.purple10, border: colors.purple30 },
    UNKNOWN: { background: colors.black10, border: colors.black20 },
  },
  slaStatus: {
    MINOR: colors.green20,
    MAJOR: colors.orange20,
    CRITICAL: colors.red20,
    YELLOW: colors.orange50,
    GREEN: colors.green50,
    RED: colors.red50,
  },
  button: {
    main: {
      normal: { background: colors.blue50, color: colors.white },
      hover: { background: colors.blue60, color: colors.white },
      active: { background: colors.blue65, color: colors.white },
      disabled: { background: colors.blue20, color: colors.white },
      loaderBg: { start: colors.blue5, end: colors.blue30 },
    },
    secondary: {
      normal: { background: colors.blue5, color: colors.blue60 },
      hover: { background: colors.blue10, color: colors.blue60 },
      active: { background: colors.blue20, color: colors.blue60 },
      disabled: { background: colors.blue5, color: colors.blue20 },
      loaderBg: { start: colors.blue30, end: colors.blue50 },
    },
    secondarySuccess: {
      normal: { background: colors.green5, color: colors.green60 },
      hover: { background: colors.green10, color: colors.green60 },
      active: { background: colors.green20, color: colors.green60 },
      disabled: { background: colors.green5, color: colors.green20 },
    },
    secondaryWarning: {
      normal: { background: colors.red5, color: colors.red60 },
      hover: { background: colors.red10, color: colors.red60 },
      active: { background: colors.red20, color: colors.red60 },
      disabled: { background: colors.red5, color: colors.red20 },
    },
    tertiary: {
      normal: { background: colors.transparent, color: colors.blue50 },
      hover: { background: colors.blue5, color: colors.blue60 },
      active: { background: colors.blue10, color: colors.blue65 },
      disabled: { background: colors.transparent, color: colors.blue10 },
    },
    expand: {
      normal: { background: colors.blue5, color: colors.blue60 },
      hover: { background: colors.blue10, color: colors.blue60 },
      active: { background: colors.blue50, color: colors.white },
    },
    link: {
      normal: { background: colors.transparent, color: colors.blue50 },
      hover: { background: colors.transparent, color: colors.blue60 },
      active: { background: colors.transparent, color: colors.blue65 },
      disabled: { background: colors.transparent, color: colors.blue10 },
    },
    linkGray: {
      normal: { background: colors.transparent, color: colors.black50 },
      hover: { background: colors.transparent, color: colors.black70 },
      active: { background: colors.transparent, color: colors.black90 },
      disabled: { background: colors.transparent, color: colors.black15 },
    },
    service: {
      normal: { background: colors.transparent, color: colors.black70 },
      hover: { background: colors.transparent, color: colors.black80 },
      active: { background: colors.transparent, color: colors.black90 },
    },
  },
  tag: {
    main: {
      normal: { border: colors.black10, color: colors.black70 },
      hover: { border: colors.black20, color: colors.black70 },
      active: { border: colors.black30, color: colors.black70 },
    },
    important: {
      normal: {
        border: colors.orange40,
        color: colors.black70,
        background: colors.orange40,
      },
      hover: {
        border: colors.orange50,
        color: colors.black70,
        background: colors.orange50,
      },
      active: { border: colors.orange50, color: colors.black70 },
    },
  },
  structureLabel: {
    TYPE_STRING: { border: colors.orange20 },
    TYPE_BOOLEAN: { border: colors.purple20 },
    TYPE_INTEGER: { border: colors.green20 },
    TYPE_NUMBER: { border: colors.pink60 },
    TYPE_BINARY: { border: colors.red20 },
    TYPE_DATETIME: { border: colors.blue20 },
    TYPE_STRUCT: { border: colors.black20 },
    TYPE_LIST: { border: colors.lightGreen60 },
    TYPE_MAP: { border: colors.turquoise40 },
    TYPE_CHAR: { border: colors.green40 },
    TYPE_TIME: { border: colors.purple5 },
    TYPE_UNION: { border: colors.blue65 },
    TYPE_DURATION: { border: colors.blue40 },
    TYPE_UNKNOWN: { border: colors.black10 },
    TYPE_REFERENCE: { border: colors.purple40 },
    TYPE_VECTOR: { border: colors.orange40 },
  },
  datasetFieldKey: {
    primary: { background: colors.black30, color: colors.white, border: colors.blue30 },
    sort: { background: colors.black30, color: colors.white, border: colors.blue10 },
    nullable: { background: colors.blue10, color: colors.black70, border: colors.blue10 },
  },
  alert: {
    OPEN: { background: colors.red10, border: colors.red20 },
    RESOLVED: { background: colors.blue10, border: colors.blue20 },
    RESOLVED_AUTOMATICALLY: { background: colors.blue10, border: colors.blue20 },
  },
  associationRequestStatus: {
    APPROVED: { background: colors.green10, border: colors.green20 },
    DECLINED: { background: colors.red10, border: colors.red20 },
    PENDING: { background: colors.blue10, border: colors.blue20 },
  },
  textField: {
    normal: { border: colors.black20, background: colors.white },
    hover: { border: colors.black50, color: colors.blue60 },
    active: { border: colors.blue50 },
    error: { border: colors.red50 },
    disabled: { border: colors.black10 },
  },
  fileInput: {
    normal: { border: colors.blue10, background: colors.black3 },
    hover: { border: colors.blue50, background: colors.black10 },
    active: { border: colors.blue65, background: colors.black10 },
    error: { border: colors.red50 },
    disabled: { border: colors.black20 },
  },
  input: {
    normal: { border: colors.black20, background: colors.white, color: colors.black30 },
    hover: { border: colors.black50, color: colors.black50 },
    active: { border: colors.blue50, color: colors.black90 },
    error: { border: colors.red50, color: colors.red50 },
    disabled: { border: colors.black10, color: colors.black20, background: colors.white },
    label: { color: colors.black50 },
    hint: { color: colors.black30 },
    searchLg: {
      normal: { border: colors.blue50, color: colors.black30 },
      hover: { border: colors.blue60, color: colors.black50 },
      active: { border: colors.blue50, color: colors.black90 },
    },
  },
  background: { default: colors.white },
  activityEvent: {
    created: colors.green10,
    updated: colors.blue5,
    deleted: colors.red5,
  },
  toast: {
    success: colors.black5,
    error: colors.red5,
    loading: '',
    blank: '',
    custom: '',
  },
  switch: { checked: colors.green40, track: colors.black10, thumb: colors.white },
  attachment: {
    normal: { background: colors.blue3, color: colors.black70 },
    hover: { background: colors.blue5, color: colors.black80 },
    active: { background: colors.blue10, color: colors.black90 },
  },
  entityStatus: {
    UNASSIGNED: {
      normal: { background: colors.blue5, color: colors.black90 },
      hover: { background: colors.blue10, color: colors.black90 },
      active: { background: colors.blue20, color: colors.black90 },
      disabled: { background: colors.blue5, color: colors.blue20 },
    },
    DRAFT: {
      normal: { background: colors.black5, color: colors.black90 },
      hover: { background: colors.black10, color: colors.black90 },
      active: { background: colors.black15, color: colors.black90 },
      disabled: { background: colors.black5, color: colors.black20 },
    },
    STABLE: {
      normal: { background: colors.green5, color: colors.black90 },
      hover: { background: colors.green10, color: colors.black90 },
      active: { background: colors.green20, color: colors.black90 },
      disabled: { background: colors.green5, color: colors.green20 },
    },
    DEPRECATED: {
      normal: { background: colors.orange5, color: colors.black90 },
      hover: { background: colors.orange10, color: colors.black90 },
      active: { background: colors.orange20, color: colors.black90 },
      disabled: { background: colors.orange5, color: colors.orange20 },
    },
    DELETED: {
      normal: { background: colors.red5, color: colors.black90 },
      hover: { background: colors.red10, color: colors.black90 },
      active: { background: colors.red20, color: colors.black90 },
      disabled: { background: colors.red5, color: colors.red20 },
    },
  },
  discussionsMessageStatus: {
    PENDING_SEND: { background: colors.black5, color: colors.black50 },
    SENT: { background: colors.green5, color: colors.green50 },
    EXTERNAL: { background: colors.blue5, color: colors.blue50 },
    DELETED: { background: colors.orange5, color: colors.orange50 },
    ERROR_SENDING: { background: colors.red5, color: colors.red50 },
  },
} as const);
